home *** CD-ROM | disk | FTP | other *** search
/ Whiteline: delta / whiteline CD Series - delta.iso / tools / utils / sgmlstos / sgmls.txt < prev    next >
Text File  |  1995-11-25  |  23KB  |  661 lines

  1.  
  2.  
  3.  
  4. SGMLS(1)                                                 SGMLS(1)
  5.  
  6.  
  7. NAME
  8.        sgmls - a validating SGML parser
  9.  
  10.        An SGML System Conforming to
  11.        International Standard ISO 8879 --
  12.        Standard Generalized Markup Language
  13.  
  14. SYNOPSIS
  15.        sgmls  [  -deglprsuv ] [ -cfile ] [ -iname ] [ filename...
  16.        ]
  17.  
  18. DESCRIPTION
  19.        Sgmls parses and validates the  SGML  document  entity  in
  20.        filename...   and  prints  on the standard output a simple
  21.        ASCII representation of its Element Structure  Information
  22.        Set.   (This  is  the  information  set which a structure-
  23.        controlled conforming SGML application should  act  upon.)
  24.        Note  that  the document entity may be spread amongst sev-
  25.        eral files; for example, the  SGML  declaration,  document
  26.        type  declaration  and document instance set could each be
  27.        in a separate file.  If no filenames are  specified,  then
  28.        sgmls  will  read  the  document  entity from the standard
  29.        input.  A filename of - can also be used to refer  to  the
  30.        standard input.
  31.  
  32.        The following options are available:
  33.  
  34.        -cfile Write  a  report  of  capacity  usage to file.  The
  35.               report is in the format of a RACT result.  RACT  is
  36.               the  Reference  Application  for  Capacity  Testing
  37.               defined in the Proposed American National  Standard
  38.               Conformance Testing for Standard Generalized Markup
  39.               Language (SGL) Systems  (X3.190-199X),  Draft  July
  40.               1991.
  41.  
  42.        -d     Warn about duplicate entity declarations.
  43.  
  44.        -e     Describe  open  entities  in error messages.  Error
  45.               messages always include the position  of  the  most
  46.               recently opened external entity.
  47.  
  48.        -g     Show the GIs of open elements in error messages.
  49.  
  50.        -iname Pretend that
  51.  
  52.                      <!ENTITY % name "INCLUDE">
  53.  
  54.               occurs  at  the start of the document type declara-
  55.               tion subset in the  SGML  document  entity.   Since
  56.               repeated definitions of an entity are ignored, this
  57.               definition will take precedence over any other def-
  58.               initions of this entity in the document type decla-
  59.               ration.  Multiple -i options are allowed.   If  the
  60.               SGML declaration replaces the reserved name INCLUDE
  61.  
  62.  
  63.  
  64.                                                                 1
  65.  
  66.  
  67.  
  68.  
  69.  
  70. SGMLS(1)                                                 SGMLS(1)
  71.  
  72.  
  73.               then the new reserved name will be the  replacement
  74.               text  of  the  entity.  Typically the document type
  75.               declaration will contain
  76.  
  77.                      <!ENTITY % name "IGNORE">
  78.  
  79.               and will use %name; in the status keyword  specifi-
  80.               cation  of  a  marked section declaration.  In this
  81.               case the effect of the option will be to cause  the
  82.               marked section not to be ignored.
  83.  
  84.        -l     Output  L  commands  giving the current line number
  85.               and filename.
  86.  
  87.        -p     Parse only the prolog.  Sgmls will exit after pars-
  88.               ing the document type declaration.  Implies -s.
  89.  
  90.        -r     Warn about defaulted references.
  91.  
  92.        -s     Suppress  output.   Error  messages  will  still be
  93.               printed.
  94.  
  95.        -u     Warn about undefined elements: elements used in the
  96.               DTD  but  not  defined.   Also warn about undefined
  97.               short reference maps.
  98.  
  99.        -v     Print the version number.
  100.  
  101.    Entity Manager
  102.        An external entity resides in  one  or  more  files.   The
  103.        entity manager component of sgmls maps a sequence of files
  104.        into an entity in three sequential stages:
  105.  
  106.        1.     each carriage return character  is  turned  into  a
  107.               non-SGML character;
  108.  
  109.        2.     each  newline character is turned into a record end
  110.               character, and at the  same  time  a  record  start
  111.               character  is  inserted  at  the  beginning of each
  112.               line;
  113.  
  114.        3.     the files are concatenated.
  115.  
  116.        A system identifier is interpreted as a list of  filenames
  117.        separated by colons.  A filename of - can be used to refer
  118.        to the standard input.  If no system  identifier  is  sup-
  119.        plied,  then the entity manager will attempt to generate a
  120.        filename using the public identifier (if there is one) and
  121.        other  information  available to it.  Notation identifiers
  122.        are not subject to this treatment.  This process  is  con-
  123.        trolled  by  the environment variable SGML_PATH; this con-
  124.        tains a colon-separated list  of  filename  templates.   A
  125.        filename template is a filename that may contain substitu-
  126.        tion  fields;  a  substitution  field  is  a  %  character
  127.  
  128.  
  129.  
  130.                                                                 2
  131.  
  132.  
  133.  
  134.  
  135.  
  136. SGMLS(1)                                                 SGMLS(1)
  137.  
  138.  
  139.        followed  by  a  single letter that indicates the value of
  140.        the substitution.  If SGML_PATH uses  the  %S  field  (the
  141.        value  of which is the system identifier), then the entity
  142.        manager will also use SGML_PATH  to  generate  a  filename
  143.        when  a system identifier that does not contain any colons
  144.        is supplied.  The value of a substitution can either be  a
  145.        string  or  it can be null.  The entity manager transforms
  146.        the list of filename templates into a list of filenames by
  147.        substituting  for  each  substitution field and discarding
  148.        any template that contained  a  substitution  field  whose
  149.        value was null.  It then uses the first resulting filename
  150.        that exists and  is  readable.   Substitution  values  are
  151.        transformed  before  being used for substitution: firstly,
  152.        any names that were subject to upper case substitution are
  153.        folded  to  lower  case;  secondly,  space  characters are
  154.        mapped to underscores and slashes are mapped to  percents.
  155.        The  value of the %S field is not transformed.  The values
  156.        of substitution fields are as follows:
  157.  
  158.        %%     A single %.
  159.  
  160.        %D     The entity's data content notation.  This substitu-
  161.               tion  will succeed only for external data entities.
  162.  
  163.        %N     The entity, notation or document type name.
  164.  
  165.        %P     The public identifier if there was a public identi-
  166.               fier, otherwise null.
  167.  
  168.        %S     The system identifier if there was a system identi-
  169.               fier otherwise null.
  170.  
  171.        %X     (This is provided  mainly  for  compatibility  with
  172.               ARCSGML.)  A three-letter string chosen as follows:
  173.                                          |            |
  174.                                          |            | With public identifier
  175.                                          |            +-------------+-----------
  176.                                          | No public  |   Device    |  Device
  177.                                          | identifier | independent | dependent
  178.               ---------------------------+------------+-------------+-----------
  179.               Data or subdocument entity | nsd        | pns         | vns
  180.               General SGML text entity   | gml        | pge         | vge
  181.               Parameter entity           | spe        | ppe         | vpe
  182.               Document type definition   | dtd        | pdt         | vdt
  183.               Link process definition    | lpd        | plp         | vlp
  184.  
  185.               The device dependent version  is  selected  if  the
  186.               public text class allows a public text display ver-
  187.               sion but no public text display version was  speci-
  188.               fied.
  189.  
  190.        %Y     The  type  of thing for which the filename is being
  191.               generated:
  192.  
  193.  
  194.  
  195.  
  196.                                                                 3
  197.  
  198.  
  199.  
  200.  
  201.  
  202. SGMLS(1)                                                 SGMLS(1)
  203.  
  204.  
  205.               SGML subdocument entity    sgml
  206.               Data entity                data
  207.               General text entity        text
  208.               Parameter entity           parm
  209.               Document type definition   dtd
  210.               Link process definition    lpd
  211.  
  212.        The value of the following  substitution  fields  will  be
  213.        null unless a valid formal public identifier was supplied.
  214.  
  215.        %A     Null if the text identifier in  the  formal  public
  216.               identifier  contains an unavailable text indicator,
  217.               otherwise the empty string.
  218.  
  219.        %C     The public text class, mapped to lower case.
  220.  
  221.        %E     The  public  text  designating   sequence   (escape
  222.               sequence) if the public text class is CHARSET, oth-
  223.               erwise null.
  224.  
  225.        %I     The empty string if the  owner  identifier  in  the
  226.               formal  public  identifier  is an ISO owner identi-
  227.               fier, otherwise null.
  228.  
  229.        %L     The public text language,  mapped  to  lower  case,
  230.               unless  the  public text class is CHARSET, in which
  231.               case null.
  232.  
  233.        %O     The owner identifier (with the +//  or  -//  prefix
  234.               stripped.)
  235.  
  236.        %R     The  empty  string  if  the owner identifier in the
  237.               formal public  identifier  is  a  registered  owner
  238.               identifier, otherwise null.
  239.  
  240.        %T     The public text description.
  241.  
  242.        %U     The  empty  string  if  the owner identifier in the
  243.               formal public identifier is an  unregistered  owner
  244.               identifier, otherwise null.
  245.  
  246.        %V     The public text display version.  This substitution
  247.               will be null if the  public  text  class  does  not
  248.               allow a display version or if no version was speci-
  249.               fied.  If an empty version was specified,  a  value
  250.               of default will be used.
  251.  
  252.  
  253.  
  254.  
  255.  
  256.  
  257.  
  258.  
  259.  
  260.  
  261.  
  262.                                                                 4
  263.  
  264.  
  265.  
  266.  
  267.  
  268. SGMLS(1)                                                 SGMLS(1)
  269.  
  270.  
  271.    System declaration
  272.        The system declaration for sgmls is as follows:
  273.  
  274.                           SYSTEM "ISO 8879:1986"
  275.                                   CHARSET
  276.        BASESET  "ISO 646-1983//CHARSET
  277.                  International Reference Version (IRV)//ESC 2/5 4/0"
  278.        DESCSET  0 128 0
  279.        CAPACITY PUBLIC  "ISO 8879:1986//CAPACITY Reference//EN"
  280.                                  FEATURES
  281.        MINIMIZE DATATAG NO  OMITTAG  YES   RANK     NO  SHORTTAG YES
  282.        LINK     SIMPLE  NO  IMPLICIT NO    EXPLICIT NO
  283.        OTHER    CONCUR  NO  SUBDOC   YES 1 FORMAL   YES
  284.        SCOPE    DOCUMENT
  285.        SYNTAX   PUBLIC  "ISO 8879:1986//SYNTAX Reference//EN"
  286.        SYNTAX   PUBLIC  "ISO 8879:1986//SYNTAX Core//EN"
  287.                                  VALIDATE
  288.                 GENERAL YES MODEL    YES   EXCLUDE  YES CAPACITY YES
  289.                 NONSGML YES SGML     YES   FORMAL   YES
  290.                                    SDIF
  291.                 PACK    NO  UNPACK   NO
  292.  
  293.        The  memory usage of sgmls is not a function of the capac-
  294.        ity points used by a document; however, sgmls  can  handle
  295.        capacities significantly greater than the reference capac-
  296.        ity set.
  297.  
  298.        In some environments, higher values may be  supported  for
  299.        the SUBDOC parameter.
  300.  
  301.        Documents  that do not use optional features are also sup-
  302.        ported.  For example, if FORMAL NO  is  specified  in  the
  303.        SGML  declaration, public identifiers will not be required
  304.        to be valid formal public identifiers.
  305.  
  306.        Certain parts of the concrete syntax may be changed:
  307.  
  308.               The shunned character numbers can be changed.
  309.  
  310.               Eight bit characters can be assigned  to  LCNMSTRT,
  311.               UCNMSTRT,  LCNMCHAR  and  UCNMCHAR.  Declaring this
  312.               requires that the syntax reference character set be
  313.               declared like this:
  314.                      BASESET   "ISO Registration Number 100//CHARSET
  315.                                 ECMA-94 Right Part of Latin Alphabet Nr. 1//ESC 2/13 4/1"
  316.                      DESCSET   0 256 0
  317.  
  318.               Uppercase substitution can be performed or not per-
  319.               formed both for entity names and for other names.
  320.  
  321.               Either short reference delimiters assigned  by  the
  322.               reference  delimiter  set  or  no  short  reference
  323.               delimiters are supported.
  324.  
  325.  
  326.  
  327.  
  328.                                                                 5
  329.  
  330.  
  331.  
  332.  
  333.  
  334. SGMLS(1)                                                 SGMLS(1)
  335.  
  336.  
  337.               The reserved names can be changed.
  338.  
  339.               The quantity set can be  increased  within  certain
  340.               limits  subject  to  there  being sufficient memory
  341.               available.  The upper limit on NAMELEN is 239.  The
  342.               upper  limits on ATTCNT, ATTSPLEN, BSEQLEN, ENTLVL,
  343.               LITLEN, PILEN, TAGLEN, and  TAGLVL  are  more  than
  344.               thirty  times  greater  than  the reference limits.
  345.               The upper limit on GRPCNT, GRPGTCNT, and GRPLVL  is
  346.               253.   NORMSEP  cannot  be  changed.   DTAGLEN  are
  347.               DTEMPLEN irrelevant since sgmls  does  not  support
  348.               the DATATAG feature.
  349.  
  350.    SGML declaration
  351.        The  SGML declaration may be omitted, the following decla-
  352.        ration will be implied:
  353.                              <!SGML "ISO 8879:1986"
  354.                                      CHARSET
  355.        BASESET  "ISO 646-1983//CHARSET
  356.                  International Reference Version (IRV)//ESC 2/5 4/0"
  357.        DESCSET    0  9 UNUSED
  358.                   9  2  9
  359.                  11  2 UNUSED
  360.                  13  1 13
  361.                  14 18 UNUSED
  362.                  32 95 32
  363.                 127  1 UNUSED
  364.        CAPACITY PUBLIC  "ISO 8879:1986//CAPACITY Reference//EN"
  365.        SCOPE    DOCUMENT
  366.        SYNTAX   PUBLIC  "ISO 8879:1986//SYNTAX Reference//EN"
  367.                                     FEATURES
  368.        MINIMIZE DATATAG NO OMITTAG  YES          RANK     NO  SHORTTAG YES
  369.        LINK     SIMPLE  NO IMPLICIT NO           EXPLICIT NO
  370.        OTHER    CONCUR  NO SUBDOC   YES 99999999 FORMAL   YES
  371.                                   APPINFO NONE>
  372.        with the exception that characters 128 through 254 will be
  373.        assigned  to  DATACHAR.  When exporting documents that use
  374.        characters in this range, an accurate description  of  the
  375.        upper  half  of the document character set should be added
  376.        to this declaration.   For  ISO  Latin-1,  an  appropriate
  377.        description would be:
  378.        BASESET   "ISO Registration Number 100//CHARSET
  379.                   ECMA-94 Right Part of Latin Alphabet Nr. 1//ESC 2/13 4/1"
  380.        DESCSET   128 32 UNUSED
  381.                  160 95 32
  382.                  255  1 UNUSED
  383.  
  384.    Output format
  385.        The output is a series of lines.  Lines can be arbitrarily
  386.        long.  Each line consists of an initial command  character
  387.        and  one  or more arguments.  Arguments are separated by a
  388.        single space, but when a command takes a fixed  number  of
  389.        arguments  the last argument can contain spaces.  There is
  390.        no space between  the  command  character  and  the  first
  391.  
  392.  
  393.  
  394.                                                                 6
  395.  
  396.  
  397.  
  398.  
  399.  
  400. SGMLS(1)                                                 SGMLS(1)
  401.  
  402.  
  403.        argument.   Arguments  can  contain  the  following escape
  404.        sequences.
  405.  
  406.        \\     A \.
  407.  
  408.        \n     A record end character.
  409.  
  410.        \|     Internal SDATA entities are bracketed by these.
  411.  
  412.        \nnn   The character whose code is nnn octal.
  413.  
  414.        A record start character  will  be  represented  by  \012.
  415.        Most  applications  will need to ignore \012 and translate
  416.        \n into newline.
  417.  
  418.        The possible command characters and arguments are as  fol-
  419.        lows:
  420.  
  421.        (gi    The start of an element whose generic identifier is
  422.               gi.  Any attributes for this element will have been
  423.               specified with A commands.
  424.  
  425.        )gi    The  end an element whose generic identifier is gi.
  426.  
  427.        -data  Data.
  428.  
  429.        &name  A reference to an external data entity  name;  name
  430.               will have been defined using an E command.
  431.  
  432.        ?pi    A processing instruction with data pi.
  433.  
  434.        Aname val
  435.               The  next  element  to  start has an attribute name
  436.               with value val which takes  one  of  the  following
  437.               forms:
  438.  
  439.               IMPLIED
  440.                      The value of the attribute is implied.
  441.  
  442.               CDATA data
  443.                      The  attribute  is  character data.  This is
  444.                      used for attributes whose declared value  is
  445.                      CDATA.
  446.  
  447.               NOTATION nname
  448.                      The attribute is a notation name; nname will
  449.                      have been defined using a N  command.   This
  450.                      is  used for attributes whose declared value
  451.                      is NOTATION.
  452.  
  453.               ENTITY name...
  454.                      The attribute is a list  of  general  entity
  455.                      names.   Each  entity  name  will  have been
  456.                      defined using an I, E or S command.  This is
  457.  
  458.  
  459.  
  460.                                                                 7
  461.  
  462.  
  463.  
  464.  
  465.  
  466. SGMLS(1)                                                 SGMLS(1)
  467.  
  468.  
  469.                      used  for attributes whose declared value is
  470.                      ENTITY or ENTITIES.
  471.  
  472.               TOKEN token...
  473.                      The attribute is a list of tokens.  This  is
  474.                      used  for attributes whose declared value is
  475.                      anything else.
  476.  
  477.        Dename name val
  478.               This is the same as the A command, except  that  it
  479.               specifies  a  data attribute for an external entity
  480.               named ename.  Any D commands will come after the  E
  481.               command  that  defines  the  entity  to  which they
  482.               apply, but before any & or A commands  that  refer-
  483.               ence the entity.
  484.  
  485.        Nnname nname.  Define a notation This command will be pre-
  486.               ceded by a p command if the notation  was  declared
  487.               with a public identifier, and by a s command if the
  488.               notation was declared with a system identifier.   A
  489.               notation will only be defined if it is to be refer-
  490.               enced in an E command or in an  A  command  for  an
  491.               attribute with a declared value of NOTATION.
  492.  
  493.        Eename typ nname
  494.               Define  an  external  data  entity named ename with
  495.               type typ (CDATA, NDATA or SDATA) and notation  not.
  496.               This command will be preceded by one or more f com-
  497.               mands giving the filenames generated by the  entity
  498.               manager  from the system and public identifiers, by
  499.               a p command if a public identifier was declared for
  500.               the  entity, and by a s command if a system identi-
  501.               fier was declared for the entity.   not  will  have
  502.               been  defined  using  a N command.  Data attributes
  503.               may be specified for the entity using  D  commands.
  504.               An  external data entity will only be defined if it
  505.               is to be referenced in a & command or in an A  com-
  506.               mand  for  an  attribute  whose  declared  value is
  507.               ENTITY or ENTITIES.
  508.  
  509.        Iename typ text
  510.               Define an internal data  entity  named  ename  with
  511.               type typ (CDATA or SDATA) and entity text text.  An
  512.               internal data entity will only be defined if it  is
  513.               referenced  in  an A command for an attribute whose
  514.               declared value is ENTITY or ENTITIES.
  515.  
  516.        Sename Define a subdocument entity named ename.  This com-
  517.               mand  will  be  preceded  by one or more f commands
  518.               giving the filenames generated by the  entity  man-
  519.               ager from the system and public identifiers, by a p
  520.               command if a public identifier was declared for the
  521.               entity,  and  by a s command if a system identifier
  522.               was declared for the entity.  A subdocument  entity
  523.  
  524.  
  525.  
  526.                                                                 8
  527.  
  528.  
  529.  
  530.  
  531.  
  532. SGMLS(1)                                                 SGMLS(1)
  533.  
  534.  
  535.               will  only  be  defined  if it is referenced in a {
  536.               command or in an A command for an  attribute  whose
  537.               declared value is ENTITY or ENTITIES.
  538.  
  539.        ssysid This  command applies to the next E, S or N command
  540.               and specifies the associated system identifier.
  541.  
  542.        ppubid This command applies to the next E, S or N  command
  543.               and specifies the associated public identifier.
  544.  
  545.        ffilename
  546.               This command applies to the next E or S command and
  547.               specifies an associated filename.   There  will  be
  548.               more than one f command for a single E or S command
  549.               if the system identifier used a colon.
  550.  
  551.        {ename The start of the  SGML  subdocument  entity  ename;
  552.               ename will have been defined using a S command.
  553.  
  554.        }ename The end of the SGML subdocument entity ename.
  555.  
  556.        Llineno file
  557.        Llineno
  558.               Set  the  current  line  number  and filename.  The
  559.               filename argument will be omitted if only the  line
  560.               number  has  changed.   This will be output only if
  561.               the -l option has been given.
  562.  
  563.        #text  An APPINFO parameter of text was specified  in  the
  564.               SGML declaration.  This is not strictly part of the
  565.               ESIS, but  a  structure-controlled  application  is
  566.               permitted  to act on it.  No # command will be out-
  567.               put if APPINFO NONE was  specified.   A  #  command
  568.               will  occur  at most once, and may be preceded only
  569.               by a single L command.
  570.  
  571.        C      This command indicates that the document was a con-
  572.               forming  SGML document.  If this command is output,
  573.               it will be the last command.  An SGML  document  is
  574.               not  conforming  if  it  references  a  subdocument
  575.               entity that is not conforming.
  576.  
  577. BUGS
  578.        Some non-SGML characters in literals are  counted  as  two
  579.        characters  for the purposes of quantity and capacity cal-
  580.        culations.
  581.  
  582. SEE ALSO
  583.        The SGML Handbook, Charles F. Goldfarb
  584.        ISO 8879 (Standard Generalized Markup Language),  Interna-
  585.        tional Organization for Standardization
  586.  
  587. ORIGIN
  588.        ARCSGML was written by Charles F. Goldfarb.
  589.  
  590.  
  591.  
  592.                                                                 9
  593.  
  594.  
  595.  
  596.  
  597.  
  598. SGMLS(1)                                                 SGMLS(1)
  599.  
  600.  
  601.        Sgmls   was   derived   from   ARCSGML   by   James  Clark
  602.        (jjc@jclark.com), to whom bugs should be reported.
  603.  
  604.  
  605.  
  606.  
  607.  
  608.  
  609.  
  610.  
  611.  
  612.  
  613.  
  614.  
  615.  
  616.  
  617.  
  618.  
  619.  
  620.  
  621.  
  622.  
  623.  
  624.  
  625.  
  626.  
  627.  
  628.  
  629.  
  630.  
  631.  
  632.  
  633.  
  634.  
  635.  
  636.  
  637.  
  638.  
  639.  
  640.  
  641.  
  642.  
  643.  
  644.  
  645.  
  646.  
  647.  
  648.  
  649.  
  650.  
  651.  
  652.  
  653.  
  654.  
  655.  
  656.  
  657.  
  658.                                                                10
  659.  
  660.  
  661.